#ifndef LOCKFILE_H_
#define LOCKFILE_H_

#include <unistd.h>
#include <fcntl.h>
#include <string>

class LockFile {

private:
	struct flock fl;
	int fd;
	std::string m_Nombre;

public:
	LockFile ();
	LockFile ( const std::string nombre );
	~LockFile();
	
	void abrir( const std::string nombre );
	int tomarLock ();
	int liberarLock ();
	ssize_t escribir ( const void* buffer,const ssize_t buffsize ) const;
	void cerrar();
	void eliminar();
};

#endif /* LOCKFILE_H_ */
